#include "HtModuleLib.h"
#include "common.h"
#include "HtThreadPool.h"
#include "DBConnectPool.h"
#include "FileLog.h"
#include "MySqlLog.h"
#include "ChipClacUnit.h"

class CModuleChip
	:public CHtModulelib
{
public:
	CModuleChip();
	~CModuleChip();
	virtual bool Init(unsigned int& nCmdId, std::weak_ptr<CHtThreadPool> pThreadPool, std::weak_ptr<CDBConnectPool> pDBPool, std::string strXml);
	virtual bool Exit();
	virtual void Update(unsigned int nMSG, UINT_PTR wparam, LONG_PTR lparam);
	
	bool update_mon_node(MONChip_CONFIG _cfg, MOD_DLL_INFO mod_info);
protected:
	bool InitLogs();
private:
	std::shared_ptr<CHtThreadPool> m_pThreadPool;
	std::shared_ptr<CDBConnectPool> m_pDBConnPool;
	std::shared_ptr<CFileLog> m_FileLog;
	std::shared_ptr<CMySqlLog> m_MySqllog;

	std::list<std::shared_ptr<CChipClacUnit>> lstUnit;

	CHtTimerInterface m_node_timer;
};